package com.wing.product.model.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wing.bill.model.enums.OrderSourceEnum;
import com.wing.bill.model.enums.TransferStatusEnum;
import com.wing.mybatis.common.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@Schema(description="产品入库表")
@Data
@EqualsAndHashCode(callSuper=true)
public class WarehouseTransferOrderVO extends BaseEntity<WarehouseTransferOrderVO> {

    @TableField(value = "transfer_code")
    @Schema(description="过户订单编号")
    private String transferCode;

    @TableField(value = "seller_customer_id")
    @Schema(description="出售方客户id")
    private Long sellerCustomerId;

    @TableField(value = "buyer_customer_id")
    @Schema(description="购买方客户id")
    private Long buyerCustomerId;

    @TableField(value = "transfer_status")
    @Schema(description="订单状态 0 待确认，1确认过户（管理员操作）")
    private Integer transferStatus;
    private String transferStatusDesc;

    public void setTransferStatus(Integer transferStatus){
        this.transferStatus = transferStatus;
        transferStatusDesc = TransferStatusEnum.getDescByCode(transferStatus);
    }

    @TableField(value = "seller_confirm")
    @Schema(description="出售方确认")
    private Integer sellerConfirm;
    private String sellerConfirmDesc;

    public void setSellerConfirm(Integer sellerConfirm){
        this.sellerConfirm = sellerConfirm;
        sellerConfirmDesc = TransferStatusEnum.getDescByCode(sellerConfirm);
    }

    @TableField(value = "buyer_confirm")
    @Schema(description="购买方确认")
    private Integer buyerConfirm;
    private String buyerConfirmDesc;

    public void setBuyerConfirm(Integer buyerConfirm){
        this.buyerConfirm = buyerConfirm;
        buyerConfirmDesc = TransferStatusEnum.getDescByCode(buyerConfirm);
    }

    @TableField(value = "seller_confirm_time")
    @Schema(description="出售方确认时间")
    private Date sellerConfirmTime;

    @TableField(value = "buyer_confirm_time")
    @Schema(description="购买方确认时间")
    private Date buyerConfirmTime;

    @TableField(value = "transfer_time")
    @Schema(description="过户时间")
    private Date transferTime;

    @TableField(value = "`source`")
    @Schema(description="数据来源")
    private Integer source;
    private String sourceDesc;

    public void setSource(Integer source){
        this.source = source;
        sourceDesc = OrderSourceEnum.getDescByCode(source);
    }

    private String buyerCustomerName;
    private String sellerCustomerName;


    private Long LoginCustomerId;

    private Integer totalProduct;

    private Long sellerContactId;
    private Long  buyerContactId;
    private String sellerPhone;
    private String buyerPhone;

    @TableField(value = "handover_Time")
    @Schema(description="交割日期")
    private Date handoverTime;

}
